import { Link } from 'umi';
import { Menu, Layout } from 'antd';
import { useState } from 'react';

const { Header, Footer, Content } = Layout;

export default function BasicLayout({ children }) {
  const [current, setCurrent] = useState('index');

  const handleClick = (e) => {
    setCurrent(e.key);
  };

  return (
    <Layout>
      <Header>
        <Menu
          onClick={handleClick}
          selectedKeys={[current]}
          mode="horizontal"
          theme="dark"
        >
          <Menu.Item key="index">
            <Link to="/">Index</Link>
          </Menu.Item>
          <Menu.Item key="employee">
            <Link to="/employee">Employee</Link>
          </Menu.Item>
          <Menu.Item key="List">
            <Link to="/employee/list">List</Link>
          </Menu.Item>
        </Menu>
      </Header>
      {children}
    </Layout>
  );
}
